<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<script type="text/javascript">
	$(function() {
		$(".continue a").button();
	});
</script>
<div id="blog-div">
	<div class="message">${action}</div>
	<c:forEach var="entity" items="${entities}">
		<article id="blog-post-summary" class="post-summary group">
			<header class="blog-title">
				<a class="" href="blogPost.jsp?blogId=${entity.id}">${entity.title}</a>
			</header>
			<p class="content-time">${entity.postedDate}</p>
			<div class="comment-cloud">
				<a href="">${fn:length(entity.comments)}</a>
			</div>
			<p class="blog-preview">
				${entity.preview} <span>[...]</span>
			</p>
			<div class="show-blog-preview-tags">
				<img class="tag-img" src="images/tag_orange.png" alt="tag" />
				<c:set var="id" value="${entity.id}"/>
				<c:forEach var="tag" items="${tagMap[id]}">
					<a class="tag-links" href="javascript:fetchBlogPostByTag('#fetch-blog-posts', ${tag.id})"><c:out value="${tag.tag}"/></a> |
				</c:forEach>
			</div>
			<div class="continue">
				<a class="" href="blogPost.jsp?blogId=${entity.id}">Continue</a>
			</div>
		</article>
	</c:forEach>
</div>


